<template>
    <div class="main-content">
      <h1>asdfasdfasdfasdf</h1>
      <button @click="getUser">当前用户</button>
      <h4>{{currentUser}}</h4>
    </div>
</template>

<script>
import { GetUser } from "@api/login.js"
import { ref } from "vue";

export default {
    name: "Console",
    setup(){
      const currentUser = ref()
      let getUser = (() => {
        GetUser()
        .then(res=>{
          console.log(res);
          currentUser.value = res.userName
        })
      })
      return { getUser, currentUser }
    }
}
</script>

<style lang="scss" scoped>
@import "@styles/config.scss";
</style>